﻿#include "defer.h"
#ifdef _MSC_VER               // 只有 MSVC
#  if _MSC_VER >= 1900        // VS2015 及以上
#    pragma execution_character_set("utf-8")
#  endif
#endif

Defer::Defer(function<void()> deleter)
    : mDeleter(deleter)
{
}

Defer::~Defer()
{
    if (mDeleter)
        mDeleter();
}
